<!DOCTYPE html>
<html lang="en">
<head>
  <title>{{$config.name}} - {{$config.description}}</title>
  <t-include file="include/assets.html"/>
  <script src="/static/lib/timeago.js/timeago.min.js"></script>
</head>
<body>
<div class="container">
  <t-include file="include/header.html"/>
  <table class="table table-bordered">
    <thead class="thead-light">
    <tr>
      <th>用户数量</th>
      <th>项目数量</th>
    </tr>
    </thead>
    <tbody>
    <tr>
      <td>{{userCount}}</td>
      <td>{{projectCount}}</td>
    </tr>
    </tbody>
  </table>
  <div class="card">
    <div class="card-header">
      <span>最近更新</span>
      <div class="float-right">
        <a href="/projects/">
          项目列表
          <i class="fa fa-chevron-right"></i>
        </a>
      </div>
    </div>
    <div class="card-body">
      <ol class="list-group-flush">
        <t-for on="project of recentList">
          <li class="list-group-item">
            <span class="badge badge-pill badge-primary" datetime="{{project.repository.updated_at}}"></span>
            <span class="badge badge-light">
              <img src="{{project.pusher.avatar_url}}" alt="{{project.pusher.username}}" width="20" />
              <span>{{project.pusher.full_name}}</span>
            </span>
            <a href="/projects/{{project.repository.full_name}}/">{{project.repository.full_name}}</a>
            <span class="text-muted">{{project.repository.description}}</span>
            <t-if on="project.commits.length">
              <ul>
                <t-for on="item of project.commits">
                  <li>
                    <span class="text-black-50">{{item.committer.name}}</span>
                    <span datetime="{{item.timestamp}}" class="text-muted"></span>
                    <span>{{item.message}}</span>
                  </li>
                </t-for>
              </ul>
            </t-if>
          </li>
        </t-for>
      </ol>
    </div>
  </div>
  <t-include file="./include/footer.html"/>
</div>
</body>
</html>
